package com.asset.dispoal.department.service;

import com.asset.dispoal.department.api.SysDepartmentService;
import com.asset.dispoal.department.dto.DepartmentRequest;
import com.asset.dispoal.department.service.commom.DepartInsertCommand;
import com.asset.dispoal.department.service.commom.DepartmentDeleteCommand;
import com.asset.dispoal.department.service.commom.DepartmentUpdateCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author qr
 * @date 2022/1/27$
 */
@Service
public class DepartmentServiceImp implements SysDepartmentService {

    @Autowired
    DepartInsertCommand departInsertCommand;
    @Autowired
    DepartmentUpdateCommand departmentUpdateCommand;
    @Autowired
    DepartmentDeleteCommand departmentDeleteCommand;

    @Override
    public void insert(DepartmentRequest request) {
        departInsertCommand.execute(request);
    }

    @Override
    public void update(DepartmentRequest request) {
        departmentUpdateCommand.execute(request);
    }

    @Override
    public void delete(DepartmentRequest request) {
        departmentDeleteCommand.execute(request);
    }
}
